package string;

public class Matches1 {
    public static void main(String[] args) {
        String email = "ly2505914982@qq.com";
        String regex = "[a-zA-Z0-9_]+@[a-zA-Z0-9]+(\\.[a-zA-Z]+)+";
        boolean m = email.matches(regex);
        if (m){
            System.out.println("邮箱格式正确");
        }else{
            System.out.println("邮箱格式错误");
        }
    }
}
